Selective Tail Call Elimination
نویسنده
چکیده
Tail calls are expected not to consume stack space in most functional languages. However, there is no support for tail calls in some environments. Even in such environments, proper tail calls can be implemented with a technique called a trampoline. To reduce the overhead of trampolining while preserving stack space asymptotically we propose selective tail call elimination based on an effect system. The effect system infers the number of successive tail calls generated by the execution of an expression, and trampolines are introduced only when they are necessary.
منابع مشابه
Tail call elimination on the Java Virtual Machine
A problem that often has to be solved by compilers for functional languages targeting the Java Virtual Machine is the elimination of tail calls. This paper explains how we solved it in our Funnel compiler and presents some experimental results about the impact our technique has on both performance and size of the compiled programs.
متن کاملProgram Transformation and Proof Transformation
A "linear style" sequent calculus makes it possible to explore the close structural relationships between primitive recursive programs and their inductive termination proofs, and between program transformations and their corresponding proof transformations. In this context the recursive to tail recursive transformation corresponds proof theoretically to a certain kind of cut elimination, called...
متن کاملBorrower : YKJ Call # : 0200103483760
1 hemorrhagiC dm white-tailed dee] virus serotype 2 a positive contra deer with viremi milliliter of bloOO on deer with viR of EHDV-2 inge lahillei. TIters of 10glO 2.7 TCIDsc: ipennis. This rep lahillei may be a
متن کاملVerification Environment in Theorema
We present a verification environment for imperative programs (using Hoare logic) and for functional programs (using fixpoint theory) in the frame of the Theorema system (www.theorema.org). In particular, we discuss some methods for finding the invariants of loops and specifications of auxiliary tail recursive functions. These methods use techniques from (polynomial) algebra and combinatorics, ...
متن کامل